Back
BMEN90033 · Week 5

Total Harmonic Distortion

If an amplifier's output doesn't perfectly match its input, the difference is distortion. Total Harmonic Distortion (THD) puts a number on how much unwanted harmonic content has crept into the signal. Below, we look at what harmonics are, how they add up to distort a waveform, how you measure them, and why any of this matters for bioinstrumentation.

Part 01

The Pure Fundamental

Every periodic signal has a fundamental frequency: the lowest frequency component, and the one that sets the signal's pitch or repetition rate. Below is a pure sine wave at a single frequency. This is what a clean, undistorted signal looks like.

440 Hz
This is the reference. Any deviation from this pure shape means distortion. So how do we measure it?
Part 02

What Are Harmonics?

Harmonics are sine waves at exact integer multiples of the fundamental frequency. The 2nd harmonic is at 2× the fundamental, the 3rd at 3×, and so on. Each harmonic has its own amplitude and phase.

Even vs odd harmonics: Push-pull amplifier topologies (Class B, AB) tend to cancel even harmonics (2nd, 4th) due to symmetry, leaving predominantly odd harmonics (3rd, 5th). Single-ended designs (Class A) produce both even and odd harmonics.
Part 03

Combining Harmonics

What happens when you add harmonics to the fundamental? Drag the sliders below to find out. The faint coloured traces are the individual harmonics; the bright white trace is everything summed together.

0%
0%
0%
0%

Load a typical amplifier harmonic profile:

Amplitude vs frequency for the current signal:

Try the presets. Notice how Class B has prominent odd harmonics (3rd, 5th) from crossover distortion, while Class A shows lower, more evenly distributed harmonics.
Part 04

Fourier Decomposition

In 1807, Joseph Fourier showed that any periodic signal can be written as a sum of sinusoids. That means you can take a distorted waveform and break it back down into the fundamental and each of its harmonics.

Hit Decompose to watch the current waveform split into its individual sine waves:

The core idea: any periodic signal, no matter how messy, is just a pile of sine waves added together. The next section covers the practical tool engineers use to pull them apart.
Part 05

The Frequency Spectrum

In practice, the Fast Fourier Transform (FFT) converts a time-domain signal into its frequency-domain representation. The output is a spectrum: amplitude vs frequency, showing every harmonic component sitting inside the signal.

This spectrum updates as you move the sliders in Part 03. The tallest bar at f is the fundamental. Anything at 2f, 3f, etc. is a harmonic that shouldn't be there.

How distortion is measured in practice: feed a pure sine into the amplifier, look at the output spectrum, and see what showed up that shouldn't be there. The ratio of those unwanted harmonics to the fundamental is THD.
Part 06

The THD Formula

THD is the root-sum-square of all the harmonic amplitudes, divided by the fundamental:

THD = √(V22 + V32 + V42 + V52) / V1 × 100%
0.00%

Each harmonic's contribution to the total:

2nd harmonic
0%
3rd harmonic
0%
4th harmonic
0%
5th harmonic
0%
THDQualityTypical Application
< 0.1%ExcellentHi-fi audio, precision instrumentation
< 1%GoodBiomedical instruments (ECG, EEG)
1 – 5%NoticeableMay affect signal integrity
> 10%HeavyUnsuitable for most measurement
Part 07

Why It Matters

Distortion means the output doesn't faithfully reproduce the input. In audio that sounds bad. In bioinstrumentation it can be dangerous.

Biosignals like ECG, EEG, and EMG carry diagnostic information in their shape and timing. Harmonic distortion can:

The tradeoff in amplifier design:

For bioinstrumentation, fidelity usually wins. A device that distorts an ECG waveform is worse than one that drains the battery faster. That said, portable and wearable devices still need good efficiency, which is why Class D amplifiers with well-designed output filters are becoming more common: high efficiency and low THD at the same time.